package com.hust.fastdev.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@Configuration
@PropertySource("classpath:application.properties")
public class ConstantConf {
    private static String url;
    private static String username;
    private static String password;

    @Value( "${spring.datasource.url}" )
    public void setUrl(String url){
        ConstantConf.url = url;
    }

    @Value( "${spring.datasource.username}" )
    public void setUsername(String username){
        ConstantConf.username = username;
    }
    @Value( "${spring.datasource.url}" )
    public void setPassword(String password){
        ConstantConf.password = password;
    }
    public static String getUrl() {
        return url;
    }

    public static String getUsername() {
        return username;
    }

    public static String getPassword() {
        return password;
    }
}
